package com.firsthomework;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TeacherTest {
	public static void main(String[] args) {
		String xmlPath="/com/firsthomework/first1.xml";
		ApplicationContext applicationContext=new ClassPathXmlApplicationContext(xmlPath);
		//构造方式输出 constructor-arg
		Teacher teacher1= (Teacher)applicationContext.getBean("teacher1");
		System.out.println("teacher1\n"+teacher1);
		//属性方式输出 property
		Teacher teacher2= (Teacher)applicationContext.getBean("teacher2");
		System.out.println("teacher2\n"+teacher2);
	}
}
